/*
 * @Author: thats-all-right-ha-ha 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @Date: 2024-04-16 12:47:48
 * @LastEditors: thats-all-right-ha-ha 8280209+thats-all-right-ha-ha@user.noreply.gitee.com
 * @LastEditTime: 2024-04-16 19:44:00
 * @FilePath: \vue-project\src\router\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEath
 */
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import('@/views/layout/index.vue'),
      redirect: '/home',
      children: [
        {
          path: '/home',
          component: () => import('@/views/home/index.vue')
        },
        {
          path: '/about',
          component: () => import('@/views/about/index.vue')
        },
        {
          path: '/enter',
          component: () => import('@/views/enter/index.vue')
        },
        {
          path: '/case',
          component: () => import('@/views/case/index.vue')
        },
        {
          path: '/news',
          component: () => import('@/views/news/index.vue')
        },
        {
          path: '/detail/:id',
          component: () => import('@/views/newsDetail/index.vue')
        }
      ]
    },
    {
      path: '/:dispath(.*)',
      component: () => import('@/views/error/index.vue')
    }
  ]
})

export default router
